﻿using System;
using UniMana.Data;

namespace UniMana.Win.Leadership
{
    public partial class Frm_Score2_EditScoreCensorship_Confirm : DevExpress.XtraEditors.XtraForm
    {
        private DBMain m_data = new DBMain();
        Log_ScoreEditInfo loginfo = new Log_ScoreEditInfo();

        public Frm_Score2_EditScoreCensorship_Confirm(Log_ScoreEditInfo loginfo)
        {
            InitializeComponent();
            this.loginfo = loginfo;
        }

        /// <summary>
        /// Đồng ý không phê duyệt phiếu điểm
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>

        private void btnYes_Click(object sender, EventArgs e)
        {
            Log_ScoreEditData.m_bFlag = true;
            loginfo.Properties.Feedback = rtbFeedback.Text;
            loginfo.Properties.Refuse = true;
            loginfo.Properties.Status = true;
            loginfo.Properties.AccountCensorship = UniMana.Utils.LoginInfo.GblLoginInfo.sysLoginUserKey;
            loginfo.Properties.DateCensorship = SysDateTime.Now;
            loginfo.Save();
            this.Close();
        }

        /// <summary>
        /// Không đồng ý không duyệt phiếu điểm
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>

        private void btnNo_Click(object sender, EventArgs e)
        {
            Log_ScoreEditData.m_bFlag = false;
            this.Close();
        }

        /// <summary>
        /// Form load
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>

        private void Frm_Score2_EditScoreCensorship_Confirm_Load(object sender, EventArgs e)
        {
            lbcID.Text = loginfo.Properties.ID + " ?";
        }
    }
}
